<?php
//define('EXPORT_JS_AND_CSS',1);
require_once 'config.php';
require_once 'init.php';

$pages = CList(CPortal::$components)->filter(array('type'=>'PAGE', 'portal'=>CPortal::$default));
$page_names = array();
$extra = array(
	'product_list'=>'&category_id=Nokia',
	'product_detail'=>'&id=623',
	'customer_profile'=>'&id=admin',
	'salesman_profile'=>'&id=admin',
	
);
foreach($pages as $page)
{
	$page_names[] = $page['name'].(isset($extra[$page['name']])?$extra[$page['name']]:'');
}

echo '<script>
var pages = '.CString($page_names)->json().';
var i = 0;
function next()
{
	if(i<pages.length)
	{
		var win = open(\'index.php?clear_cache=yes&page=\'+pages[i]);
		i++;
		setTimeout(next, 4000);
		
	}
}
next();
</script>';
CSystem::end();
?>